package com.bruce.learnrecycler.kotlin.model.shjt.alllines;

import org.simpleframework.xml.Attribute;
import org.simpleframework.xml.ElementList;
import org.simpleframework.xml.Root;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by Bruce-Home on 2015/8/23.
 */
@Root(strict = false)
public class PxLineXml implements LineXml {
    @ElementList(name = "lines", inline = true)
    private List<PxLine> lines;

    @Attribute(required = false)
    private String version;

    private List<Line> retLines;
    public PxLineXml() {
    }

    public synchronized List<Line> getLines() {
        if (lines == null) return null;
        if (retLines == null) {
            retLines = new ArrayList<>();
            for (PxLine line : lines) {
                retLines.add(line);
            }
        }
        return retLines;
    }

    public void setLines(List<PxLine> lines) {
        this.lines = lines;
    }

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Override
    public String toString() {
        return super.toString();
    }
}
